<template>
    <div class="page">
        <div class="header">
            <div class="headerContent">
                <div>Hi，欢迎来到工程5188信息共享平台！</div>
                <div class="flex-start">
                    <div @click="$router.push('/')" style="cursor: pointer;">工程5188首页</div>
                    <div class="m-l-36" @click="$router.push('/vipCenter')" style="cursor: pointer;">服务中心</div>
                </div>
            </div>
        </div>
        <div class="headerCompany">
            <div class="headerCompanyContent">
                <div class="flex-start">
                    <div class="headerCompanyContenttitle">欢迎您：{{ userInfo.name }}</div>
                </div>
                <div class="flex-start">
                    <div class="lookItem m-l-62" @click="exit" style="cursor: pointer;">
                        <img class="lookIcon" src="@/static/engineering5188/supplier/exitx.png" alt="">
                        退出
                    </div>
                </div>
            </div>
        </div>
        <div class="pageContent">
            <div class="leftBar">
                <div class="menuItem">
                    <img class="logo" src="@/static/engineering5188/supplier/user.png" alt="">
                    <span class="menuItemTitle">业务员专区</span>
                </div>
                <div :class="{ 'activeMenu': $route.path === '/businessPersonnel/userInfo', 'noactiveMenu': $route.path !== '/businessPersonnel/userInfo' }"
                    @click="$router.push('/businessPersonnel/userInfo')">
                    个人资料
                </div>
                <div :class="{ 'activeMenu': $route.path === '/businessPersonnel/commission', 'noactiveMenu': $route.path !== '/businessPersonnel/commission' }"
                    @click="$router.push('/businessPersonnel/commission')">
                    我的佣金
                </div>
                <div :class="{ 'activeMenu': $route.path === '/businessPersonnel/invite', 'noactiveMenu': $route.path !== '/businessPersonnel/invite' }"
                    @click="$router.push('/businessPersonnel/invite')">
                    我的邀请
                </div>
                <div :class="{ 'activeMenu': $route.path === '/businessPersonnel/modifyPassword', 'noactiveMenu': $route.path !== '/businessPersonnel/modifyPassword' }"
                    @click="$router.push('/businessPersonnel/modifyPassword')">
                    修改密码
                </div>
            </div>

            <div class="right">
                <router-view></router-view>
            </div>
        </div>

    </div>
</template>

<script>
import { mapState } from "vuex";

export default {
    computed: {
        ...mapState([
            "userInfo",
        ]),
    },
    data() {
        return {}
    },
    created() {
        console.log(this.userInfo)
    },
    methods: {

        exit() {
            this.$store.commit("clear_loginInfo");
            alertSucc("已退出登录");
            this.$router.push("/");
        },
    }
}
</script>



<style scoped lang="less">
.page {
    width: 100%;
    height: 100%;
    background-color: #F6F6F6;

    .header {
        width: 100%;
        height: 36px;
        background: #F6F6F6;
    }

    .headerContent {
        width: 1200px;
        height: 100%;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 14px;
        color: #333333;
    }

    .flex-start {
        display: flex;
        align-items: center;
    }

    .m-l-36 {
        margin-left: 36px;
    }

    .headerCompany {
        height: 80px;
        background: #31A41B;
    }

    .headerCompanyContent {
        width: 1200px;
        height: 100%;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .headerCompanyContenttitle {
        font-family: PingFang SC, PingFang SC;
        font-weight: 600;
        font-size: 18px;
        color: #FFFFFF;
    }

    .headerCompanyContenttitleVip {
        width: 112px;
        height: 36px;
        background: #EAF6E8;
        border: 1px solid #31A41B;
        font-weight: 500;
        font-size: 14px;
        color: #31A41B;
        text-align: center;
        line-height: 36px;
        border-radius: 20px;
    }

    .lookIcon {
        width: 20px;
        height: 20px;
    }

    .lookItem {
        color: #FFFFFF;
        font-weight: 600;
        font-size: 18px;
    }

    .m-l-62 {
        margin-left: 62px;
    }

    .pageContent {
        width: 1200px;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        margin-top: 20px;

        .leftBar {
            width: 220px;
            height: 698px;
            background: #FFFFFF;
            border-radius: 0px 0px 0px 0px;

            .logo {
                width: 24px;
                height: 24px;
            }

            .menuItem {
                height: 55px;
                padding-left: 16px;
                display: flex;
                align-items: center;
            }

            .menuItemTitle {
                font-weight: bold;
                font-size: 16px;
                color: #333333;
                line-height: 21px;
                margin-left: 6px;
            }

            .activeMenu {
                height: 40px;
                padding-left: 46px;
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 14px;
                color: #041E3A;
                background: #F2F9F0;
                display: flex;
                align-items: center;
                border-left: 4px solid #31A41B;
                cursor: pointer;
            }

            .noactiveMenu {
                height: 40px;
                padding-left: 46px;
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 14px;
                color: #666666;
                background: #fff;
                display: flex;
                align-items: center;
                border-left: 4px solid #fff;
                cursor: pointer;
            }
        }

        .right {
            width: 960px;
            background: #FFFFFF;
        }
    }
}
</style>